<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

namespace Database\Seeders;

use App\Enums\CheckStatusEnum;
use App\Models\CheckUserProfile;
use App\Models\User;
use App\Models\UserProfile;
use Illuminate\Database\Seeder;

class UserProfileSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run()
    {
        User::factory()->create();
        UserProfile::factory()->create([
            'user_id' => 1,
            'identity' => 2,
            'check_status' => CheckStatusEnum::CHECK_ADOPT,
            'id_card_number' => '130281199701110712',
        ]);
        return;
        for ($i = 0; $i < 100; ++$i) {
            $idCardNum = rand(10000000000, 90000000000);
            $user = User::factory()->create();
            UserProfile::factory()->create([
                'user_id' => 0,
                'identity' => $user->identity,
                'check_status' => CheckStatusEnum::CHECK_ADOPT,
                'id_card_number' => $idCardNum,
            ]);
            if ($i % 2 == 0) {
                continue;
            }
            CheckUserProfile::factory()->create([
                'user_id' => $user->id,
                'identity' => $user->identity,
                'check_status' => CheckStatusEnum::CHECK_ING,
                'id_card_number' => $idCardNum,
            ]);
        }
    }
}
